﻿@{
    ViewBag.PageTitle = "洪峰智能";

    Layout = "~/Views/Shared/PageTemplate.cshtml";

}
<script>

        function getInfo() {
        $.post("getDeviceInfo", {  "random": Math.random() }, function (result) {
                var jsonresult = result.data;

            if (result.respCode == "200") {
                $("#deviceCount").text(jsonresult.deviceCount + "个") ;
                $("#deviceErrorCount").text(jsonresult.deviceErrorCount+"个") ;
                $("#deviceOnLineCount").text(jsonresult.deviceOnLineCount+"个") ;
                $("#sensorCount").text(jsonresult.sensorCount+"个");
                $("#valveCount").text(jsonresult.valveCount + "个");
                $("#sensorDataCount").text(jsonresult.sensorDataCount + "条");
                $("#mqDataCount").text(jsonresult.mqDataCount + "次");
                }
                else {
                alert(result.respMsg);
                    return;
                }
            });
        }

    $(document).ready(function () {
        //do something
        getInfo();
        setInterval(function () { getInfo() }, 10000);
    });

</script>
    <style>
        .dtitle {
            font-size: 18px;
            font-weight: bold;
            margin-top: 30px;
            text-align: center;
            color:dodgerblue
        }

        .dnum {
            font-size: 16px;
            margin-top: 10px;
            text-align: center;
            color:red;
        }

        .dinfo {
            float: left;
            width: 160px;
            height: 130px;
            background-color: whitesmoke;
            margin-right: 50px;
            border-radius: 10px;
            margin-top:20px;
        }
    </style>

    <div id="saper-container">
        <form id="searchForm" name="searchForm" action="" method="post">
            <div id="saper-hd"></div>
            <div id="saper-bd">
                <div class="subfiled clearfix">
                    <h2>系统状态</h2>
                </div>
                <div class="subfiled-content">
                    <div class="search-box clearfix">
                    </div>


                </div>
            </div>
        </form>


    </div>
    <div style="width:95%;margin:0px auto;">
        <div class="dinfo">
            <div class="dtitle">设备数</div>
        <div class="dnum" id="deviceCount"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">异常设备</div>
        <div class="dnum" id="deviceErrorCount"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">在线网关数</div>
        <div class="dnum" id="deviceOnLineCount"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">传感器数量</div>
        <div class="dnum" id="sensorCount"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">执行器数量</div>
        <div class="dnum" id="valveCount"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">24小时数据采集量</div>
        <div class="dnum" id="sensorDataCount"></div>
        </div>
        <div class="dinfo">
            <div class="dtitle">24时网关通讯量</div>
        <div class="dnum" id="mqDataCount"></div>
        </div>
    </div>
  <div style="height:100px;clear:both"></div>
    <div style="margin:0px auto;width:661px;"><img src="/file/upload/pi-5-banner-img.png" /></div>
